//
//  NewContactCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/1/23.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "NewContactCell.h"
#import <UIImageView+WebCache.h>

@interface NewContactCell()
@property (weak, nonatomic) IBOutlet UIImageView *bgImgView;
@property (weak, nonatomic) IBOutlet UIButton *zanBtn;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;


@end

@implementation NewContactCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setModel:(CommendModel *)model
{
    _model = model;
    [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:model.backImage] placeholderImage:GetImage(@"commendPlace")];
    [self.zanBtn setTitle:[NSString stringWithFormat:@"%zd",model.likeCount] forState:UIControlStateNormal];
    self.nameLab.text = [NSString stringWithFormat:@"%@ | %@",model.personName,model.personIntroduce];
    if ([model.likeStatus isEqualToString:@"1"]) {
        self.zanBtn.selected = YES;
    }else {
        self.zanBtn.selected = NO;
    };
}
- (IBAction)zanClick:(UIButton *)btn
{
    if (self.zanClickBlock) {
        self.zanClickBlock(self.model, btn);
    }
}
- (IBAction)shareClick:(UIButton *)btn
{
    if (self.shareBlock) {
        self.shareBlock(self.model);
    }
}


@end
